<template>
  <div id="app">
    <div class="container">
      <carousel
        :autoPlay= 'true'
        :duration= '2000'
        :initial = '2'
        :hasDot = 'true'
        :hasDirector = 'true'
        dotBgColor='red'
      >
        <car-item
          v-for='(item, index) of carData'
          :key="index"
          :idx = 'index'
        >
          <img :src="require(`./assets/img/${item.img_name}`)" alt="">
        </car-item>
      </carousel>
    </div>
  </div>
</template>

<script>
import carData from '@/data/crarouse.js'
export default {
  name: 'App',
  data () {
    return {
      carData: carData
    }
  }
}
</script>

<style scoped>
  .container{
    width: 520px;
    height: 280px;
    margin:150px auto;
  }
</style>
